package com.xuewei.pagedemo.controller;


import com.xuewei.pagedemo.entity.TUser;
import com.xuewei.pagedemo.service.ITUserService;
import com.xuewei.pagedemo.vo.PageVo;
import com.xuewei.springcloudcommon.vo.Result;
import jdk.nashorn.internal.ir.RuntimeNode;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.List;
import java.util.Map;

/**
 * <p>
 *  前端控制器
 * </p>
 *
 * @author zhangxuewei
 * @since 2023-04-10
 */
@RestController
@RequestMapping("/user")
public class TUserController {

    @Autowired
    ITUserService userService;

    @GetMapping(value = "/get/{id}")
    public Result getById(@PathVariable Integer id){
        TUser byId = userService.getById(id);
        return Result.ok(byId);
    }

    @GetMapping(value = "/add")
    public void add(){
        userService.add();
    }

}

